#!/bin/sh
#
#  This shell script gives you some examples how to use the units library.
#

# Here we include libinclude.sh
. libinclude.sh

# Here we import the units library:
import units

# Example 1: A simple calculation.
echo
echo 'Example 1:'
echo -n "calculate: (45.88*2^4-1.4)/1.345e3 = "
units_clc "(45.88*2^4-1)/1.345e3"

# Example 2: Calculate with units.
echo
echo 'Example 2:'
echo -n "calculate with units: 2.3 km + 236.5m = "
units_clc "2.3 km + 236.5m"
echo -n "and in km: "
units_clc "2.3 km + 236.5m" 'km'

# Example 3: Convert between units.
echo
echo 'Example 3:'
echo -n "convert: 56*kg/m3 to g/cm3: "
units_clc '56*kg/m3' 'g/cm3'
echo -n "and without units: "
units_clc -n '56*kg/m3' 'g/cm3'

# Example 4: Get definition.
echo
echo 'Example 4:'
echo -n "get definition for '255.67e-6 J': "
units_clc -u '255.67e-6 J'

